package com.sg.service.biz.app.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.sg.common.util.RedisUtil;
import com.sg.dto.base.app.req.BatchQueryTargetCatReq;
import com.sg.dto.base.app.req.BatchQueryTargetObjListReq;
import com.sg.dto.base.app.req.QueryEvaObjTargetCycleListReq;
import com.sg.dto.biz.app.req.*;
import com.sg.dto.biz.app.res.*;
import com.sg.dto.integration.component.BatchQueryUnstructuredRelationshipComReqDto;
import com.sg.dto.integration.component.BatchQueryUnstructuredRelationshipComRespDto;
import com.sg.entity.OmsEvaluationObjectTargetCycle;
import com.sg.entity.OmsTargetCategory;
import com.sg.entity.OmsTargetObjective;
import com.sg.service.base.app.MOmsEvaluationObjectTargetCycleService;
import com.sg.service.base.app.MOmsTargetCategoryService;
import com.sg.service.base.app.MOmsTargetObjectiveService;
import com.sg.service.biz.app.DashboardTargetContentService;
import com.sg.service.biz.app.nb.NbNetDiskTargetContent;
import com.sg.common.exception.Assert;
import com.wicket.okrapp.common.exception.BizException;
import com.wicket.okrcomponent.integration.UnstructuredDataService;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Service
public class NetDiskTargetContentServiceImpl
        implements com.wicket.okrapp.biz.service.NetDiskTargetContentService {

    @Resource
    private RedisUtil redisUtil;
    //@Resource
    //private MCustomFields5Service mCustomFields5Service;
    @Resource
    private MOmsTargetCategoryService mOmsTargetCategoryService;
    @Resource
    private MOmsTargetObjectiveService mOmsTargetObjectiveService;
    @Resource
    private NbNetDiskTargetContent nbNetDiskTargetContent;
    @Resource
    private MOmsEvaluationObjectTargetCycleService mOmsEvaluationObjectTargetCycleService;
    @Resource
    private UnstructuredDataService unstructuredDataService;
    @Resource
    private DashboardTargetContentService dashboardTargetContentService;
//@Resource
    //private DashboardTargetContentService dashboardTargetContentService;

    /**
     * D3分析网盘树节点下级内容(公共)[8841]
     * gen by moon at 3/27/2024, 10:47:35 PM
     */
    @Trace(operationName = "D3分析网盘树节点下级内容(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public AnalysisNetDiskTreeSubordinateComRespDto analysisNetDiskTreeSubordinateCom(AnalysisNetDiskTreeSubordinateComReqDto reqDto) {


        ImplementEightReceivingFieldRespDto receptionServiceRes_3 = null;
//virtualUsage M3-约定目标内容类型：目标分类、指标  65348
        //ModelCode: receptionService
        ImplementEightReceivingFieldRespDto receptionServiceRes = null;
        ImplementEightReceivingFieldReqDto receptionServiceReq = new ImplementEightReceivingFieldReqDto();
        receptionServiceReq.setCustomField1("TARGET_CATEGORY");//CUSTOM_CONVENTION//sourceId:1661435_1_65348
        receptionServiceReq.setCustomField2("OBJECTIVE");//CUSTOM_CONVENTION//sourceId:1661436_1_65348

        /*M3-约定目标内容类型：目标分类、指标[8691]  用于特殊方法接收上游入参。 */
        Assert.isNull(receptionServiceReq.getCustomField1(), "D3分析网盘树节点下级内容(公共)-M3-约定目标内容类型：目标分类、指标-自定义字段1不能为空", false);
        Assert.isNull(receptionServiceReq.getCustomField2(), "D3分析网盘树节点下级内容(公共)-M3-约定目标内容类型：目标分类、指标-自定义字段2不能为空", false);
        receptionServiceRes = nbNetDiskTargetContent.implementEightReceivingField(receptionServiceReq);


        if ((reqDto != null && reqDto.getTargetCycleContentTypeCode() != null && reqDto.getTargetCycleContentTypeCode().equals("TARGET") && reqDto != null && reqDto.getSubTargetContentList() != null && reqDto.getSubTargetContentList().size() > 0)) {
            //if((D3分析网盘树节点下级内容(公共).上级目标内容类型编码 等于 目标 and D3分析网盘树节点下级内容(公共).下级目标内容列表数据集条数 大于 0))  65341

            List<OmsTargetCategory> listOmsTargetCategory = new ArrayList<>();
            BatchQueryTargetCatReq batchQueryTargetCatReq = new BatchQueryTargetCatReq();
            batchQueryTargetCatReq.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1661322_1_65347
            if (reqDto != null) {
                batchQueryTargetCatReq.setSetConstructionTaskList(reqDto.getSubTargetContentList());//list-field-assign//sourceId:1661321_1_65347
                batchQueryTargetCatReq.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1661328_1_65347
            }

            /*3-3-02批量查目标分类列表[2254]   */
            Assert.isNull(batchQueryTargetCatReq.getEvaluationTemplateId(), "D3分析网盘树节点下级内容(公共)-3-3-02批量查目标分类列表-冗余评价模板ID不能为空", false);
            Assert.isNull(batchQueryTargetCatReq.getSubjectLifeCycle(), "D3分析网盘树节点下级内容(公共)-3-3-02批量查目标分类列表-主体生命周期不能为空", false);
            listOmsTargetCategory = mOmsTargetCategoryService.batchQueryTargetCat(batchQueryTargetCatReq)/*vcase invoke 本地 method 方法调用;*/;


//ModelCode: receptionService
            ImplementEightReceivingFieldRespDto receptionServiceRes_2 = null;
            if (listOmsTargetCategory != null && !CollectionUtil.isEmpty(listOmsTargetCategory) && listOmsTargetCategory.size() > 0) {
                ImplementEightReceivingFieldReqDto receptionServiceReq_1 = new ImplementEightReceivingFieldReqDto();
                if (listOmsTargetCategory != null && !CollectionUtil.isEmpty(listOmsTargetCategory) && listOmsTargetCategory != null && !CollectionUtil.isEmpty(listOmsTargetCategory)) {
                    ImplementEightReceivingFieldRespDto finalReceptionServiceRes = receptionServiceRes;
                    receptionServiceReq_1.setSubTargetContentList(//objList-to-objLists
                            listOmsTargetCategory.stream().map(item -> {
                                SubTargetContentDto elm = new SubTargetContentDto();
                                elm.setTagetContentId(item.getTargetCategoryId());//SimpleFieldAssign//sourceId:320016_2_65349
                                elm.setTargetContentCode(item.getTargetCategoryCode());//SimpleFieldAssign//sourceId:320017_2_65349
                                elm.setTargetContentName(item.getTargetCategoryName());//SimpleFieldAssign//sourceId:320018_2_65349
                                elm.setIsLastTargetContent(item.getIsLast());//SimpleFieldAssign//sourceId:320019_2_65349
                                if (finalReceptionServiceRes != null) {
                                    elm.setTargetContentTypeCode(finalReceptionServiceRes.getCustomField1());//两个数组关联数量不一致; 导致逐个赋值; 有概率付错值; //SimpleFieldAssign//sourceId:320015_2_65349
                                }
                                return elm;
                            }).collect(Collectors.toList()));//objList-to-objLists//sourceId:1661456_1_65349
                }

                /*M3-接收下级目标内容列表[8691]  用于特殊方法接收上游入参。 */

                receptionServiceRes_2 = nbNetDiskTargetContent.implementEightReceivingField(receptionServiceReq_1);


                receptionServiceRes_3 = receptionServiceRes_2;
            }
        } else if ((reqDto != null && reqDto.getTargetCycleContentTypeCode() != null && reqDto.getTargetCycleContentTypeCode().equals("TARGET_CATEGORY") && reqDto != null && reqDto.getIsLastTargetContent() != null && reqDto.getIsLastTargetContent().equals("FALSE") && reqDto != null && reqDto.getSubTargetContentList() != null && reqDto.getSubTargetContentList().size() > 0)) {
            //elseif((D3分析网盘树节点下级内容(公共).上级目标内容类型编码 等于 目标分类 and D3分析网盘树节点下级内容(公共).上级是否末级目标内容 等于 否 and D3分析网盘树节点下级内容(公共).下级目标内容列表数据集条数 大于 0))  65342

            List<OmsTargetCategory> listOmsTargetCategory_2 = new ArrayList<>();
            BatchQueryTargetCatReq batchQueryTargetCatReq_1 = new BatchQueryTargetCatReq();
            batchQueryTargetCatReq_1.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1661322_1_65350
            if (reqDto != null) {
                batchQueryTargetCatReq_1.setSetConstructionTaskList(reqDto.getSubTargetContentList());//list-field-assign//sourceId:1661321_1_65350
                batchQueryTargetCatReq_1.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1661328_1_65350
            }

            /*3-3-02批量查目标分类列表[2254]   */
            Assert.isNull(batchQueryTargetCatReq_1.getEvaluationTemplateId(), "D3分析网盘树节点下级内容(公共)-3-3-02批量查目标分类列表-冗余评价模板ID不能为空", false);
            Assert.isNull(batchQueryTargetCatReq_1.getSubjectLifeCycle(), "D3分析网盘树节点下级内容(公共)-3-3-02批量查目标分类列表-主体生命周期不能为空", false);
            listOmsTargetCategory_2 = mOmsTargetCategoryService.batchQueryTargetCat(batchQueryTargetCatReq_1)/*vcase invoke 本地 method 方法调用;*/;


//ModelCode: receptionService
            ImplementEightReceivingFieldRespDto receptionServiceRes_4 = null;
            if (listOmsTargetCategory_2 != null && !CollectionUtil.isEmpty(listOmsTargetCategory_2) && listOmsTargetCategory_2.size() > 0) {
                ImplementEightReceivingFieldReqDto receptionServiceReq_2 = new ImplementEightReceivingFieldReqDto();
                if (listOmsTargetCategory_2 != null && !CollectionUtil.isEmpty(listOmsTargetCategory_2) && listOmsTargetCategory_2 != null && !CollectionUtil.isEmpty(listOmsTargetCategory_2)) {
                    ImplementEightReceivingFieldRespDto finalReceptionServiceRes1 = receptionServiceRes;
                    receptionServiceReq_2.setSubTargetContentList(//objList-to-objLists
                            listOmsTargetCategory_2.stream().map(item -> {
                                SubTargetContentDto elm = new SubTargetContentDto();
                                elm.setTagetContentId(item.getTargetCategoryId());//SimpleFieldAssign//sourceId:320016_2_65351
                                elm.setTargetContentCode(item.getTargetCategoryCode());//SimpleFieldAssign//sourceId:320017_2_65351
                                elm.setTargetContentName(item.getTargetCategoryName());//SimpleFieldAssign//sourceId:320018_2_65351
                                elm.setIsLastTargetContent(item.getIsLast());//SimpleFieldAssign//sourceId:320019_2_65351
                                if (finalReceptionServiceRes1 != null) {
                                    elm.setTargetContentTypeCode(finalReceptionServiceRes1.getCustomField1());//两个数组关联数量不一致; 导致逐个赋值; 有概率付错值; //SimpleFieldAssign//sourceId:320015_2_65351
                                }
                                return elm;
                            }).collect(Collectors.toList()));//objList-to-objLists//sourceId:1661456_1_65351
                }

                /*M3-接收下级目标内容列表[8691]  用于特殊方法接收上游入参。 */

                receptionServiceRes_4 = nbNetDiskTargetContent.implementEightReceivingField(receptionServiceReq_2);


                receptionServiceRes_3 = receptionServiceRes_4;
            }
        } else if ((reqDto != null && reqDto.getTargetCycleContentTypeCode() != null && reqDto.getTargetCycleContentTypeCode().equals("TARGET_CATEGORY") && reqDto != null && reqDto.getIsLastTargetContent() != null && reqDto.getIsLastTargetContent().equals("TRUE") && reqDto != null && reqDto.getSubTargetContentList() != null && reqDto.getSubTargetContentList().size() > 0)) {
            //elseif((D3分析网盘树节点下级内容(公共).上级目标内容类型编码 等于 目标分类 and D3分析网盘树节点下级内容(公共).上级是否末级目标内容 等于 是 and D3分析网盘树节点下级内容(公共).下级目标内容列表数据集条数 大于 0))  65343

            List<OmsTargetObjective> listOmsTargetObjective = new ArrayList<>();
            BatchQueryTargetObjListReq batchQueryTargetObjListReq = new BatchQueryTargetObjListReq();
            batchQueryTargetObjListReq.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1661439_1_65352
            if (reqDto != null) {
                batchQueryTargetObjListReq.setTargetObjList(reqDto.getSubTargetContentList());//list-field-assign//sourceId:1661437_1_65352
                batchQueryTargetObjListReq.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1661438_1_65352
            }

            /*3-3-03批量查指标列表[2203]   */
            Assert.isNull(batchQueryTargetObjListReq.getEvaluationTemplateId(), "D3分析网盘树节点下级内容(公共)-3-3-03批量查指标列表-冗余评价模板ID不能为空", false);
            Assert.isNull(batchQueryTargetObjListReq.getSubjectLifeCycle(), "D3分析网盘树节点下级内容(公共)-3-3-03批量查指标列表-主体生命周期不能为空", false);
            listOmsTargetObjective = mOmsTargetObjectiveService.batchQueryTargetObjList(batchQueryTargetObjListReq)/*vcase invoke 本地 method 方法调用;*/;


//ModelCode: receptionService
            ImplementEightReceivingFieldRespDto receptionServiceRes_5 = null;
            if (listOmsTargetObjective != null && !CollectionUtil.isEmpty(listOmsTargetObjective) && listOmsTargetObjective.size() > 0) {
                ImplementEightReceivingFieldReqDto receptionServiceReq_3 = new ImplementEightReceivingFieldReqDto();
                if (listOmsTargetObjective != null && !CollectionUtil.isEmpty(listOmsTargetObjective) && listOmsTargetObjective != null && !CollectionUtil.isEmpty(listOmsTargetObjective)) {
                    ImplementEightReceivingFieldRespDto finalReceptionServiceRes2 = receptionServiceRes;
                    receptionServiceReq_3.setSubTargetContentList(//objList-to-objLists
                            listOmsTargetObjective.stream().map(item -> {
                                SubTargetContentDto elm = new SubTargetContentDto();
                                elm.setTagetContentId(item.getObjectiveId());//SimpleFieldAssign//sourceId:320016_2_65353
                                elm.setTargetContentCode(item.getObjectiveCode());//SimpleFieldAssign//sourceId:320017_2_65353
                                elm.setTargetContentName(item.getObjectiveName());//SimpleFieldAssign//sourceId:320018_2_65353
                                elm.setIsLastTargetContent(item.getIsLastObjective());//SimpleFieldAssign//sourceId:320019_2_65353
                                if (finalReceptionServiceRes2 != null) {
                                    elm.setTargetContentTypeCode(finalReceptionServiceRes2.getCustomField2());//两个数组关联数量不一致; 导致逐个赋值; 有概率付错值; //SimpleFieldAssign//sourceId:320015_2_65353
                                }
                                return elm;
                            }).collect(Collectors.toList()));//objList-to-objLists//sourceId:1661456_1_65353
                }

                /*M3-接收下级目标内容列表[8691]  用于特殊方法接收上游入参。 */

                receptionServiceRes_5 = nbNetDiskTargetContent.implementEightReceivingField(receptionServiceReq_3);


                receptionServiceRes_3 = receptionServiceRes_5;
            }
        } else if ((reqDto != null && reqDto.getTargetCycleContentTypeCode() != null && reqDto.getTargetCycleContentTypeCode().equals("OBJECTIVE") && reqDto != null && reqDto.getIsLastTargetContent() != null && reqDto.getIsLastTargetContent().equals("FALSE") && reqDto != null && reqDto.getSubTargetContentList() != null && reqDto.getSubTargetContentList().size() > 0)) {
            //elseif((D3分析网盘树节点下级内容(公共).上级目标内容类型编码 等于 指标 and D3分析网盘树节点下级内容(公共).上级是否末级目标内容 等于 否 and D3分析网盘树节点下级内容(公共).下级目标内容列表数据集条数 大于 0))  65344

            List<OmsTargetObjective> listOmsTargetObjective_2 = new ArrayList<>();
            BatchQueryTargetObjListReq batchQueryTargetObjListReq_1 = new BatchQueryTargetObjListReq();
            batchQueryTargetObjListReq_1.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1661439_1_65354
            if (reqDto != null) {
                batchQueryTargetObjListReq_1.setTargetObjList(reqDto.getSubTargetContentList());//list-field-assign//sourceId:1661437_1_65354
                batchQueryTargetObjListReq_1.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1661438_1_65354
            }

            /*3-3-03批量查指标列表[2203]   */
            Assert.isNull(batchQueryTargetObjListReq_1.getEvaluationTemplateId(), "D3分析网盘树节点下级内容(公共)-3-3-03批量查指标列表-冗余评价模板ID不能为空", false);
            Assert.isNull(batchQueryTargetObjListReq_1.getSubjectLifeCycle(), "D3分析网盘树节点下级内容(公共)-3-3-03批量查指标列表-主体生命周期不能为空", false);
            listOmsTargetObjective_2 = mOmsTargetObjectiveService.batchQueryTargetObjList(batchQueryTargetObjListReq_1)/*vcase invoke 本地 method 方法调用;*/;


//ModelCode: receptionService
            ImplementEightReceivingFieldRespDto receptionServiceRes_6 = null;
            if (listOmsTargetObjective_2 != null && !CollectionUtil.isEmpty(listOmsTargetObjective_2) && listOmsTargetObjective_2.size() > 0) {
                ImplementEightReceivingFieldReqDto receptionServiceReq_4 = new ImplementEightReceivingFieldReqDto();
                if (listOmsTargetObjective_2 != null && !CollectionUtil.isEmpty(listOmsTargetObjective_2) && listOmsTargetObjective_2 != null && !CollectionUtil.isEmpty(listOmsTargetObjective_2)) {
                    ImplementEightReceivingFieldRespDto finalReceptionServiceRes3 = receptionServiceRes;
                    receptionServiceReq_4.setSubTargetContentList(//objList-to-objLists
                            listOmsTargetObjective_2.stream().map(item -> {
                                SubTargetContentDto elm = new SubTargetContentDto();
                                elm.setTagetContentId(item.getObjectiveId());//SimpleFieldAssign//sourceId:320016_2_65355
                                elm.setTargetContentCode(item.getObjectiveCode());//SimpleFieldAssign//sourceId:320017_2_65355
                                elm.setTargetContentName(item.getObjectiveName());//SimpleFieldAssign//sourceId:320018_2_65355
                                elm.setIsLastTargetContent(item.getIsLastObjective());//SimpleFieldAssign//sourceId:320019_2_65355
                                if (finalReceptionServiceRes3 != null) {
                                    elm.setTargetContentTypeCode(finalReceptionServiceRes3.getCustomField2());//两个数组关联数量不一致; 导致逐个赋值; 有概率付错值; //SimpleFieldAssign//sourceId:320015_2_65355
                                }
                                return elm;
                            }).collect(Collectors.toList()));//objList-to-objLists//sourceId:1661456_1_65355
                }

                /*M3-接收下级目标内容列表[8691]  用于特殊方法接收上游入参。 */

                receptionServiceRes_6 = nbNetDiskTargetContent.implementEightReceivingField(receptionServiceReq_4);


                receptionServiceRes_3 = receptionServiceRes_6;
            }
        } else if ((reqDto != null && reqDto.getTargetCycleContentTypeCode() != null && reqDto.getTargetCycleContentTypeCode().equals("OBJECTIVE") && reqDto != null && reqDto.getIsLastTargetContent() != null && reqDto.getIsLastTargetContent().equals("TRUE"))) {
            //elseif((D3分析网盘树节点下级内容(公共).上级目标内容类型编码 等于 指标 and D3分析网盘树节点下级内容(公共).上级是否末级目标内容 等于 是))  65345

//异常结束 65346
            throw new BizException("C00028", "对不起，没有数据！！", false);
        } else {
            //else  65356

//异常结束 65357
            throw new BizException("500", "系统异常，请联系管理员！", false);
        }
        AnalysisNetDiskTreeSubordinateComRespDto retData = new AnalysisNetDiskTreeSubordinateComRespDto();
        if (receptionServiceRes_3 != null) {
            retData.setSubTargetContentList(receptionServiceRes_3.getSubTargetContentList().stream().map(item -> BeanUtil.toBean(item, SubTargetContentDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:1661457_1
        }


        return retData;
    }

    /**
     * D3查询网盘树节点下级内容列表(公共)[8837]
     * gen by moon at 3/29/2024, 8:49:51 PM
     */
    @Trace(operationName = "D3查询网盘树节点下级内容列表(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QueryNetDiskTreeSubordinateListComRespDto queryNetDiskTreeSubordinateListCom(QueryNetDiskTreeSubordinateListComReqDto reqDto) {


        AnalysisNetDiskTreeSubordinateComRespDto analysisNetDiskTreeSubordinateComRespDto_1 = null;
//virtualUsage D3查询下级目标周期列表(公共)  65366
        QuerySubEvaObjjTargetCycleListComRespDto querySubEvaObjjTargetCycleListComRespDto = null;
        QuerySubEvaObjjTargetCycleListComReqDto querySubEvaObjjTargetCycleListComReqDto = new QuerySubEvaObjjTargetCycleListComReqDto();
        querySubEvaObjjTargetCycleListComReqDto.setIsParentCycle("TRUE");//sourceId:1662433_1_65366
        querySubEvaObjjTargetCycleListComReqDto.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1662438_1_65366
        if (reqDto != null) {
            querySubEvaObjjTargetCycleListComReqDto.setEvaObjTypeCode(reqDto.getEvaObjTypeCode());//SimpleFieldAssign//sourceId:1662431_1_65366
            querySubEvaObjjTargetCycleListComReqDto.setParentEvaObjTargetCycleId(reqDto.getParentEvaObjTargetCycleId());//SimpleFieldAssign//sourceId:1662432_1_65366
            querySubEvaObjjTargetCycleListComReqDto.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1662436_1_65366
        }

        /*D3查询下级目标周期列表(公共)[8869]   */
        Assert.isNull(querySubEvaObjjTargetCycleListComReqDto.getEvaObjTypeCode(), "D3查询网盘树节点下级内容列表(公共)-D3查询下级目标周期列表(公共)-被评对象类型编码不能为空", false);
        Assert.isNull(querySubEvaObjjTargetCycleListComReqDto.getIsParentCycle(), "D3查询网盘树节点下级内容列表(公共)-D3查询下级目标周期列表(公共)-是否父周期不能为空", false);
        Assert.isNull(querySubEvaObjjTargetCycleListComReqDto.getSubjectLifeCycle(), "D3查询网盘树节点下级内容列表(公共)-D3查询下级目标周期列表(公共)-主体生命周期不能为空", false);
        Assert.isNull(querySubEvaObjjTargetCycleListComReqDto.getEvaluationTemplateId(), "D3查询网盘树节点下级内容列表(公共)-D3查询下级目标周期列表(公共)-冗余评价模板ID不能为空", false);
        querySubEvaObjjTargetCycleListComRespDto = dashboardTargetContentService.querySubEvaObjjTargetCycleListCom(querySubEvaObjjTargetCycleListComReqDto)/*vcase invoke isSameApp*/;


        if ((querySubEvaObjjTargetCycleListComRespDto != null && querySubEvaObjjTargetCycleListComRespDto.getEvaObjTargetCycleList() != null && querySubEvaObjjTargetCycleListComRespDto.getEvaObjTargetCycleList().size() > 0)) {
            //if(D3查询下级目标周期列表(公共).被评对象目标周期列表数据集条数 大于 0)  65336

            BatchQueryUnstructuredRelationshipComRespDto batchQueryUnstructuredRelationshipComRespDto = null;
            if (querySubEvaObjjTargetCycleListComRespDto != null) {
                BatchQueryUnstructuredRelationshipComReqDto batchQueryUnstructuredRelationshipComReqDto = new BatchQueryUnstructuredRelationshipComReqDto();
                if (querySubEvaObjjTargetCycleListComRespDto != null && querySubEvaObjjTargetCycleListComRespDto.getEvaObjTargetCycleList() != null && !CollectionUtil.isEmpty(querySubEvaObjjTargetCycleListComRespDto.getEvaObjTargetCycleList())) {
                    batchQueryUnstructuredRelationshipComReqDto.setUnstructuredRelationshipList(querySubEvaObjjTargetCycleListComRespDto.getEvaObjTargetCycleList().stream().map(item -> item.getTargetCycleContentId())
                            .collect(Collectors.toList()));/*list-to-strings*///sourceId:1661111_1_65337
                }
                if (reqDto != null) {
                    batchQueryUnstructuredRelationshipComReqDto.setThemeContentId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1661140_1_65337
                }

                /*D2批量查询文档关系By父内容id(公共)[8833]   */
                Assert.isNull(batchQueryUnstructuredRelationshipComReqDto.getThemeContentId(), "D3查询网盘树节点下级内容列表(公共)-D2批量查询文档关系By父内容id(公共)-主题内容ID不能为空", false);
                batchQueryUnstructuredRelationshipComRespDto = unstructuredDataService.batchQueryUnstructuredRelationshipCom(batchQueryUnstructuredRelationshipComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


            }
            if ((batchQueryUnstructuredRelationshipComRespDto != null && batchQueryUnstructuredRelationshipComRespDto.getUnstructuredRelationshipList() != null && batchQueryUnstructuredRelationshipComRespDto.getUnstructuredRelationshipList().size() > 0)) {
                //if(D2批量查询文档关系By父内容id(公共).文档关系列表数据集条数 大于 0)  65338

                AnalysisNetDiskTreeSubordinateComRespDto analysisNetDiskTreeSubordinateComRespDto = null;
                if (batchQueryUnstructuredRelationshipComRespDto != null) {
                    AnalysisNetDiskTreeSubordinateComReqDto analysisNetDiskTreeSubordinateComReqDto = new AnalysisNetDiskTreeSubordinateComReqDto();
                    if (reqDto != null) {
                        analysisNetDiskTreeSubordinateComReqDto.setTargetCycleContentTypeCode(reqDto.getTargetCycleContentTypeCode());//SimpleFieldAssign//sourceId:1661442_1_65358
                        analysisNetDiskTreeSubordinateComReqDto.setIsLastTargetContent(reqDto.getIsLastTargetContent());//SimpleFieldAssign//sourceId:1661451_1_65358
                        analysisNetDiskTreeSubordinateComReqDto.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1661445_1_65358
                    }
                    if (batchQueryUnstructuredRelationshipComRespDto != null) {
                        analysisNetDiskTreeSubordinateComReqDto.setSubTargetContentList(batchQueryUnstructuredRelationshipComRespDto.getUnstructuredRelationshipList());//list-field-assign//sourceId:1661446_1_65358
                    }

                    /*D3分析网盘树节点下级内容(公共)[8841]   */
                    Assert.isNull(analysisNetDiskTreeSubordinateComReqDto.getTargetCycleContentTypeCode(), "D3查询网盘树节点下级内容列表(公共)-D3分析网盘树节点下级内容(公共)-上级目标内容类型编码不能为空", false);
                    Assert.isNull(analysisNetDiskTreeSubordinateComReqDto.getIsLastTargetContent(), "D3查询网盘树节点下级内容列表(公共)-D3分析网盘树节点下级内容(公共)-上级是否末级目标内容不能为空", false);
                    Assert.isNull(analysisNetDiskTreeSubordinateComReqDto.getEvaluationTemplateId(), "D3查询网盘树节点下级内容列表(公共)-D3分析网盘树节点下级内容(公共)-冗余评价模板ID不能为空", false);
                    analysisNetDiskTreeSubordinateComRespDto = analysisNetDiskTreeSubordinateCom(analysisNetDiskTreeSubordinateComReqDto)/*vcase invoke 同服务,同domain*/;


                    analysisNetDiskTreeSubordinateComRespDto_1 = analysisNetDiskTreeSubordinateComRespDto;
                }
            }
        }
        QueryNetDiskTreeSubordinateListComRespDto retData = new QueryNetDiskTreeSubordinateListComRespDto();
        if (analysisNetDiskTreeSubordinateComRespDto_1 != null) {
            retData.setSubTargetContentList(analysisNetDiskTreeSubordinateComRespDto_1.getSubTargetContentList().stream().map(item -> BeanUtil.toBean(item, SubTargetContentDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:1661459_1
        }


        return retData;
    }

    /**
     * D3查询网盘评价树列表(公共)[8838]
     * gen by moon at 3/27/2024, 11:09:16 PM
     */
    @Trace(operationName = "D3查询网盘评价树列表(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QueryNetDiskEvaTreeListComRespDto queryNetDiskEvaTreeListCom(QueryNetDiskEvaTreeListComReqDto reqDto) {


        List<OmsEvaluationObjectTargetCycle> listOmsEvaluationObjectTargetCycle_1 = new ArrayList<>();
//步骤0: 3-3-09查被评对象目标周期列表（根据周期时间范围） - queryEvaObjTargetCycleList
        List<OmsEvaluationObjectTargetCycle> listOmsEvaluationObjectTargetCycle = new ArrayList<>();
        QueryEvaObjTargetCycleListReq queryEvaObjTargetCycleListReq = new QueryEvaObjTargetCycleListReq();
        if (reqDto != null) {
            queryEvaObjTargetCycleListReq.setEvaObjTypeCode(reqDto.getEvaObjTypeCode());//SimpleFieldAssign//sourceId:1661070_1
            queryEvaObjTargetCycleListReq.setIsParentCycle(reqDto.getIsParentCycle());//SimpleFieldAssign//sourceId:1661071_1
            queryEvaObjTargetCycleListReq.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:1661073_1
            queryEvaObjTargetCycleListReq.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1661072_1
        }

        /*3-3-09查被评对象目标周期列表（根据周期时间范围）[2190]   */
        Assert.isNull(queryEvaObjTargetCycleListReq.getEvaObjTypeCode(), "D3查询网盘评价树列表(公共)-3-3-09查被评对象目标周期列表（根据周期时间范围）-被评对象类型编码不能为空", false);
        Assert.isNull(queryEvaObjTargetCycleListReq.getIsParentCycle(), "D3查询网盘评价树列表(公共)-3-3-09查被评对象目标周期列表（根据周期时间范围）-是否父周期不能为空", false);
        Assert.isNull(queryEvaObjTargetCycleListReq.getSubjectLifeCycle(), "D3查询网盘评价树列表(公共)-3-3-09查被评对象目标周期列表（根据周期时间范围）-主体生命周期不能为空", false);
        listOmsEvaluationObjectTargetCycle = mOmsEvaluationObjectTargetCycleService.queryEvaObjTargetCycleList(queryEvaObjTargetCycleListReq)/*vcase invoke 本地 method 方法调用;*/;


        listOmsEvaluationObjectTargetCycle_1 = listOmsEvaluationObjectTargetCycle;

        QueryNetDiskEvaTreeListComRespDto retData = new QueryNetDiskEvaTreeListComRespDto();
        retData.setEvaObjTargetCycleList(listOmsEvaluationObjectTargetCycle_1.stream().map(item -> BeanUtil.toBean(item, EvaObjTargetCycleDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:1661117_1


        return retData;
    }
    //
}
